package com.tubi.lambda1;

//带参数和返回值
public class test5lambda {
    public static void main(String[] args) {
        userCalculator(new Calculator() {
            @Override
            public int calc(int a, int b) {

                return a + b;
            }
        });

        userCalculator((int a,int b)->{
            return a+b;
        });
    }
    public static void userCalculator(Calculator calculator){
        calculator.calc(10, 10);
    }


}
interface  Calculator {
    int calc(int a ,int b);
}